﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
using System.Threading.Tasks;

namespace WinformMDB
{
    class Functions
    {
        /// <summary>
        /// 从大表中截取指定行
        /// </summary>
        /// <param name="dBig">大表</param>
        /// <param name="dSmall">小表</param>
        /// <param name="start">起始行</param>
        /// <param name="end">结束行</param>
        /// <returns>返回截取后的小表</returns>
        public static DataTable CopyRows(DataTable dBig, DataTable dSmall, int start, int end)
        {
            //截取几行
            dSmall = dBig.Clone();
            for (int i = start; i <= end; i++)
                dSmall.ImportRow(dBig.Rows[i]);
            return dSmall;
        }
    }

}